//路由配置文件  vue-router 全家桶路由
import {createRouter, createWebHashHistory} from "vue-router";
import Login from "../views/Login.vue";
//1.先导入虚拟界面
import Register from "../views/Register.vue";
import Manager from "../views/Manager.vue";
import AddAdminInfo from "../views/adminInfo/AddAdminInfo.vue";
import AdminInfoList from "../views/adminInfo/AdminInfoList.vue";
import CustomInfoList from "../views/customInfo/CustomInfoList.vue";
import AddMovieInfo from "../views/movieInfo/AddMovieInfo.vue";
import MovieInfoList from "../views/movieInfo/MovieInfoList.vue";
import AddHallInfo from "../views/hallInfo/AddHallInfo.vue";
import HallInfoList from "../views/hallInfo/HallInfoList.vue";
import AddPlanInfo from "../views/planInfo/AddPlanInfo"
import PlanInfoList from "../views/planInfo/PlanInfoList.vue";

//创建路由管理对象
const router=createRouter({
  //路由配置
  history : createWebHashHistory(),
  //配置虚拟页面（路由路径）
  routes:[
    //重定向 打开网页希望默认跳到Login页面
    {
      path:"/",
      redirect:{
        name:"Login"
      }
    },
    {
      path:"/Login",
      component:Login,
      name:"Login"
    },
    //2.配置路由对象
    {
      path:"/Register",
      component:Register,
      name:"Register"

    },
    {
      path:"/Manager",
      component:Manager,
      name:"Manager",
      children:[
        {
          // 二级路径简写，前面没有斜线
          // path:"/Manager/AddAdminInfo",
          path:"AddAdminInfo",
          component:AddAdminInfo,
          name:"AddAdminInfo"
        },
        {
          path:"AdminInfoList",
          component:AdminInfoList,
          name:"AdminInfoList"
        },
        {
          path:"CustomInfoList",
          component:CustomInfoList,
          name:"CustomInfoList"
        },
        {
          path:"AddMovieInfo",
          component:AddMovieInfo,
          name:"AddMovieInfo"
        },
        {
          path:"MovieInfoList",
          component:MovieInfoList,
          name:"MovieInfoList"
        },
        {
          path:"AddHallInfo",
          component:AddHallInfo,
          name:"AddHallInfo"
        },
        {
          path:"HallInfoList",
          component:HallInfoList,
          name:"HallInfoList"
        },
        {
          path:"PlanInfoList",
          component:PlanInfoList,
          name:"PlanInfoList"
        },
        {
          path:"AddPlanInfo",
          component:AddPlanInfo,
          name:"AddPlanInfo"
        }
      ]
    }
  ]
});
export default router;